package com.easylinkin.linkappapi.lobar.constant;

/**
 * @author xiaoyang
 * @version 1.0
 * @date 2022/07/22
 * @description
 */
public interface LobarConstant {
  /**
   * 告警规则
   */
  enum WarningRule {

    /**
     * 连续未出勤
     */
    ABSENT_WARNING("absent_", "{0} {1} {2} 连续{3}天未出勤预警 {4} {5} {6} {7} {8} {9}"),
    /**
     * 连续未出勤自动退场
     */
    AUTOMATIC_EXIT_WARNING("automatic_exit_", "{0} {1} {2} 连续{3}天未出勤自动退场 {4} {5} {6} {7} {8} {9}"),
    /**
     * 班组出勤率低预警
     */
    GROUP_WARNING("group_", "{0} {1} {2} 出勤率低于{3}%预警 {4} {5} {6} {7} {8} {9}"),
    /**
     * 人员超龄
     */
    AGE_WARNING("man_age_", "{0} {1} {2} 人员超龄 {3} {4} {5} {6} {7} {9}"),
    /**
     * 证书过期
     */
    CERTIFICATE_EXPIRED_WARNING("certificate_expired", "{0} {1} {2} 证书已过期 {3} {4} {5} {6} {7} {8}"),
    /**
     * 证书即将过期
     */
    CERTIFICATE_WILL_EXPIRED_WARNING("certificate_will_expired", "{0} {1} {2} 剩余{3}天证书过期 {4} {5} {6} {7} {8} {9}"),
    /**
     * 疫情监测-体温预警
     */
    TEMPERATURE_WARNING("temperature_", "{0} {1} {2} 体温大于{3} {4} {5} {6} {7} {8} {9}"),
    /**
     * 疫情监测-健康码预警
     */
    HEALTH_CODE_WARNING("health_code_", "{0} {1} {2} 健康码异常 {3} {4} {5} {6} {7} {8}"),
    /**
     * 疫情监测-体温预警&健康码预警
     */
    HEALTH_CODE_TEMPERATURE_WARNING("temperature_health_code_", "{0} {1} {2} 体温大于{3},健康码异常 {3} {4} {5} {6} {7} {8}"),

    /**
     * 人员未出场异常
     */
    USER_NO_OUT_WARNING("no_out_code_", "{0} {1} {2} 超{3}点未出场 {4} {5} {6} {7} {8} {9}"),
    /**
     * 人员停留超时
     */
    USER_STAY_OUT_WARNING("stay_out_code_", "{0} {1} {2} 到{3}点停留超时 {4} {5} {6} {7} {8} {9}"),
    ;

    private final String type;
    private final String rule;

    WarningRule(String type, String rule) {
      this.type = type;
      this.rule = rule;
    }

    public String getType() {
      return type;
    }

    public String getRule() {
      return rule;
    }
  }

  /**
   * 预警类型
   */
  interface WaringType {

    /**
     * 人员出勤预警
     */
    Integer USER_WARNINNG = 1;

    /**
     * 班组预警
     */
    Integer GROUP_WARNING = 2;

    /**
     * 年龄预警
     */
    Integer AGE_WARNING = 3;

    /**
     * 证书预警
     */
    Integer CERTIFICATE_WARNING = 4;

    /**
     * 人员出场异常预警
     */
    Integer USER_OUTIN_WARNING = 5;

    /**
     * 疫情预警
     */
    Integer EPIDEMIC_WARNING = 6;

  }

  /**
   * 告警消息模板
   */
  enum WarningMsgTemplate {

    /**
     * 连续未出勤
     */
    ABSENT_WARNING("absent_", "{0} {1}班组的{2}连续{3}天未出勤, 请及时处理/知晓"),
    /**
     * 连续未出勤自动退场
     */
    AUTOMATIC_EXIT_WARNING("automatic_exit_", "{0} {1}班组的{2}连续{3}天未出勤已自动退场, 请及时处理/知晓"),
    /**
     * 班组出勤率低预警
     */
    GROUP_WARNING("group_", "{0} {1}班组的出勤率低于{2}%，请及时处理"),
    /**
     * 人员超龄
     */
    AGE_WARNING("man_age_", "{0} {1}班组的{2}已超龄，请及时处理"),
    /**
     * 证书过期
     */
    CERTIFICATE_EXPIRED_WARNING("certificate_expired", "{0} {1}班组的{2}证书已过期，请及时处理"),
    /**
     * 证书即将过期
     */
    CERTIFICATE_WILL_EXPIRED_WARNING("certificate_will_expired", "{0} {1}班组的{2}的证书剩余{3}天即将过期，请及时处理"),
    /**
     * 疫情监测-体温预警
     */
    TEMPERATURE_WARNING("temperature_", "{0} {1} {2} {3} 疫情预警-体温{4}℃ 请及时处理"),
    /**
     * 疫情监测-健康码预警
     */
    HEALTH_CODE_WARNING("health_code_", "{0} {1} {2} {3} 疫情预警-{4}，请及时处理"),
    /**
     * 疫情监测-体温预警&健康码预警
     */
    HEALTH_CODE_TEMPERATURE_WARNING("temperature_health_code_",
        "{0} {1} {2} {3} 疫情预警-{4}，体温{5}℃，请及时处理"),

    /**
     * 人员未出场异常
     */
    USER_NO_OUT_WARNING("no_out_code_", "{0} {1}班组的{2}超{3}点未出场，请及时处理"),
    /**
     * TODO 人员停留超时
     */
    USER_STAY_OUT_WARNING("stay_out_code_", "{0} {1} {2} 到{3}点停留超时 {4} {5} {6} {7} {8} {9}"),
    ;

    private final String type;
    private final String rule;

    WarningMsgTemplate(String type, String rule) {
      this.type = type;
      this.rule = rule;
    }

    public String getType() {
      return type;
    }

    public String getRule() {
      return rule;
    }
  }

  String[] codes = {"", "绿码", "黄码", "灰码", "红码"};

}
